package com.jxt.myjxtmanager.ui.fragment;

import android.content.Intent;
import android.view.View;
import android.widget.Button;

import com.jxt.myjxtmanager.BaseFragment;
import com.jxt.myjxtmanager.R;
import com.jxt.myjxtmanager.ui.activity.AskForLeaveActivity;
import com.jxt.myjxtmanager.ui.activity.CheckWorkActivity;
import com.jxt.myjxtmanager.ui.activity.CourseActivity;
import com.jxt.myjxtmanager.ui.activity.SchoolCalendarActivity;
import com.jxt.myjxtmanager.ui.activity.StudentClassShowActivity;
import com.jxt.myjxtmanager.ui.activity.StudentMsgActivity;
import com.jxt.myjxtmanager.ui.activity.SubjectCountActivity;
import com.jxt.myjxtmanager.ui.activity.TodayknowActivity;
import com.jxt.myjxtmanager.ui.activity.WebViewtActivity;


/**
 * Created by qm on 2017/2/8 0008.
 * 资讯公告（西亚斯新闻-重要新闻） http://news.sias.edu.cn/channels/309.html
 */
public class HomeFragment extends BaseFragment {
    private Button btn_home_msg;
    private Button btn_check_work;
    private Button btn_student_msg;//师生信息
    private Button btn_today_know;
    private Button btn_class_show;
    private Button btn_score_count;
    private Button btn_school_calendar;
    private Button btn_course;//课程安排
    private Button btn_leave;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_home_layout;
    }

    @Override
    protected void initView() {
        btn_home_msg = (Button) mView.findViewById(R.id.btn_home_msg);
        btn_check_work = (Button) mView.findViewById(R.id.btn_check_work);
        btn_student_msg = (Button) mView.findViewById(R.id.btn_student_msg);
        btn_today_know = (Button) mView.findViewById(R.id.btn_today_know);
        btn_class_show = (Button) mView.findViewById(R.id.btn_class_show);
        btn_score_count = (Button) mView.findViewById(R.id.btn_score_count);
        btn_school_calendar = (Button) mView.findViewById(R.id.btn_school_calendar);
        btn_course = (Button) mView.findViewById(R.id.btn_course);
        btn_leave = (Button) mView.findViewById(R.id.btn_leave);
        btn_home_msg.setOnClickListener(this);
        btn_check_work.setOnClickListener(this);
        btn_student_msg.setOnClickListener(this);
        btn_today_know.setOnClickListener(this);
        btn_class_show.setOnClickListener(this);
        btn_score_count.setOnClickListener(this);
        btn_school_calendar.setOnClickListener(this);
        btn_course.setOnClickListener(this);
        btn_leave.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_home_msg://资讯公告  http://www.moe.gov.cn/was5/web/search?searchword=%27%xxlb=71%%27&channelid=277865   http://news.sias.edu.cn/channels/309.html
                startActivity(new Intent(getActivity(), WebViewtActivity.class).putExtra("title", "资讯公告").putExtra("url", "http://www.moe.gov.cn/was5/web/search?searchword=%27%xxlb=71%%27&channelid=277865"));
                break;
            case R.id.btn_check_work://考勤
                startActivity(new Intent(getActivity(), CheckWorkActivity.class));
                break;
            case R.id.btn_student_msg:
                startActivity(new Intent(getActivity(), StudentMsgActivity.class));
                break;
            case R.id.btn_today_know:
                startActivity(new Intent(getActivity(), TodayknowActivity.class));
                break;
            case R.id.btn_class_show://班级展示
                startActivity(new Intent(getActivity(), StudentClassShowActivity.class));
                break;
            case R.id.btn_score_count://成绩统计
                startActivity(new Intent(getActivity(), SubjectCountActivity.class));
                break;
            case R.id.btn_school_calendar:
                startActivity(new Intent(getActivity(), SchoolCalendarActivity.class));
                break;
            case R.id.btn_course://课程安排
                startActivity(new Intent(getActivity(), CourseActivity.class));
                break;
            case R.id.btn_leave:
                startActivity(new Intent(getActivity(), AskForLeaveActivity.class));
                break;
        }
    }
}
